using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Pitoshka.Tools.Helpers
{
	public class WebHelper
	{
		public static void SetNoCache(HttpResponse Response, System.Web.UI.Page Page)
		{
			Response.AddHeader("pragma", "no-cache");
			Response.CacheControl = "no-cache";

			Response.Cache.SetNoStore();

			HtmlMeta expiresTag = new HtmlMeta();
			expiresTag.Name = "expires";
			expiresTag.Content = "0";
			Page.Header.Controls.Add(expiresTag);

			HtmlMeta cacheControlTag = new HtmlMeta();
			cacheControlTag.Name = "cache-control";
			cacheControlTag.Content = "no-cache";
			Page.Header.Controls.Add(cacheControlTag);

			HtmlMeta pragmaTag = new HtmlMeta();
			pragmaTag.Name = "pragma";
			pragmaTag.Content = "no-cache";
			Page.Header.Controls.Add(pragmaTag);
		}

	}
}
